﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using Acando.Dynamics.CRM.Silverlight.Library.Controls.FieldControls;
using System.Xml.Linq;
using Acando.Dynamics.CRM.Silverlight.Library.MetaSdk;
using Acando.Dynamics.CRM.Silverlight.Library.Interfaces;
//using  Acando.Dynamics.CRM.Silverlight.Library.CrmProxyWcf;

namespace Acando.Dynamics.CRM.Silverlight.Library.Controls
{
    /// <summary>
    /// Interaction logic for ColumnControl.xaml
    /// </summary>
    public partial class RowControl : UserControl
    {
        public RowControl()
        {
            InitializeComponent();
        }

        public RowControl(IRecordControl mainControl, EntityMetadata metadata, XElement rowDefintion)
            : this()
        {
            foreach (var cell in rowDefintion.Elements("cell"))
            {
                this.listPanel.Children.Add(new CrmFieldControl(mainControl, metadata, cell));
            }
        }

    }
}
